<template>
    <div class="main">
        <home v-if="user.type === 1"></home>
        <!--        <keep-alive v-else>-->
        <!--            <component v-bind:is="$options.components.MatchmakerSingleMarket"></component>-->
        <matchmaker-single-market v-else></matchmaker-single-market>
        <!--        </keep-alive>-->
    </div>
</template>

<script lang="ts">
    import {Component, Prop, Vue, Watch} from "vue-property-decorator";
    import VerificationUnit from "@/unit/VerificationUnit";
    import Scene from "@/render/Scene";
    import Http from "@/service/Http";
    import {updateUser} from "@/store/dispatches";
    import CommonUnit from "@/unit/CommonUnit";
    import {InterfaceUser} from "@/interface/InterfaceUser";
    import {Action, State} from "vuex-class";
    import Home from "@/views/Home.vue";
    import MatchmakerSingleMarket from "@/views/MatchmakerSingleMarket.vue";

    @Component({
        components: {
            Home, MatchmakerSingleMarket
        }
    })
    export default class Main extends Scene {
        @State("UserStore")
        private user!: InterfaceUser;

        private created():void{
            if (this.user.gender === 0) {
                this.switchTab({name: "mineAvatarAndSex"});
            }
        }
    }
</script>

<style scoped lang="stylus">
    .main
        width 100vw;
        height calc(100vh - 47px - var(--safe-area-inset-bottom))
</style>
